home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
F1 Licenseware
/
F1 Licenseware - Volume 1.iso
/
disks
/
003.dms
/
003.adf
/
TEXT
/
chapter19.txt
< prev
next >
Wrap
Text File
|
1992-09-02
|
4KB
|
131 lines
The Absolute Beginners Guide To Amos
-------------------------------------
Chapter Nineteen
----------------
In this chapter I will be covering the more important of Amos`s drawing
commands.
PLOT
----
Looking at the Amos manual I can`t think of any other way to explain this
simple command. PLOT draws a single pixel of colour on your screen at the
specified coordinates i.e.
PLOT 0,0
Would PLOT a pixel of the current INK colour at the very top left hand edge
of your screen. The X coordinates (Across) Range from 0 to 319 and the Y
coords from 0 to 199 (the second 0 in the example).
Just a quick word about INK, which we haven`t covered yet.
The reason I haven`t explained the INK command so far was to save confusion
with the PEN command.
PEN, if you remember, controls the colour of PRINTED text.
INK on the other hand controls the colour of graphic drawing operations like
PLOT and the rest of the commands we will be examining in this chapter.
INk also controls the colours of another command called TEXT, but forget that
for now.
So, getting back to PLOT, we can add an INK option to the PLOT command like
this:
PLOT 0,0,1
This will PLOT a pixel at 0,0 in INK colour 1.
Try typing this line into Amos.
FOR A=1 to 1000: PLOT RND(319), RND(199),RND(15): NEXT A
You should be able to work out exactly what this line does, if not check
out each command from previous chapters. As an exercise try doing a
break down of this line yourself, saves me doing it!
DRAW
----
DRAW a line. The DRAW command is virtually the same set up as PLOT except
you must give a second set of coordinates. The start of your line and the
end coordinates of your line:
DRAW 0,0 TO 100,0
Will DRAW a straight line 100 pixels long from the top left hand edge of your
screen. DRAW uses the current INK setting as it`s colour.
You can DRAW some nice patterns with this command see EXAMPLE19.Amos for some
ideas.
As we have covered screen coordinates quite a lot, from now on I will
refer to any set of coordinates as X and Y. X is across the screen and Y is
up or down the screen. For example:
PLOT x,y
DRAW x1,y1 TO x2,y2
X just means insert your x coordinate here and the y, the y coordinates.
x1,y1 to x2,y2 simply means the second set of x,y coordinates in the same
command.
Why am I complicating things? Well this is standard practice and you will
need to know this to understand the Amos manual and other more advanced
tutorials.
BOX
---
Here is a very useful and easy to use command.
BOX draws a BOX on screen at the specified coordinates:
BOX x1,y1 TO x2,y2
X1,Y1 are the coordinates of the top left hand edge of the box.
X2,Y2 are the coordinates of bottom right edge of your box.
See EXAMPLE19.Amos for the BOX command in action.
CIRCLE x,y,r
------------
The CIRCLE command, believe it not, draws a triangle on the screen!!! Only
kidding, it draws a CIRCLE of course. X an Y are the coordinates of the
centre of the circle and R stands for the radius (size) of the circle.
For example:
CIRCLE 100,90,50
The dead centre of the circle will be 100 across and 90 pixels down the
screen and the radius will be 50 pixels. See EXAMPLE19.Amos
BAR x1,y1 TO x2,y2
-------------------
This command draws a filled rectangle (a bar) using the same coordinates
system as DRAW.
In any of the above commands you can leave out the x,y coordinates altogether
but you must leave a comma in each place instead like this:
PLOT ,
What Amos will do in this case is PLOT a pixel at the current position of the
GRAPHICS CURSOR, do not confuse this with the TEXT CURSOR.
This is useful to remember as a lot of other Amos commands utilize this
trick. Check the manual for which commands use this.
If you need to find out the current position of the graphics cursor then
you can use the XGR and YGR commands:
X=XGR
Y=YGR
Now X will hold the X coordinate and Y the Y coordinate of the graphics
cursors current position.
There are quite a few more drawing functions in Amos, most people will never
use more than I have described here so I think I have taken you far enough
down this road, for now at least.
End of chapter nineteen.